import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../components/Home'
import AllAr from '../components/AllAr'
import ArDetail from '../components/ArDetail'
import Middle from '../components/Middle'
import AddPost from '../components/AddPost'
import Search from '../components/Search'
import MiddleAllAr from '../components/MiddleAllAr'

Vue.use(VueRouter)

const routes = [
  {
    name: 'home',

    path: '/',
    component: Home
  }, {
    name: 'allAr',
    path: '/allAr/:cid/:page/:orderBy',
    component: AllAr
  }, {
    name: 'arDetail',
    path: '/arDetail/:cid/:id',
    component: ArDetail
  }, {
    name: 'middle',
    path: '/middle/:cid/:id',
    component: Middle
  }, {
    name: 'middleAllAr',
    path: '/middleAllAr/:cid/:page/:orderBy',
    component: MiddleAllAr,
    meta: {
      title: '过渡页面'
    }
  }, {
    name: 'addPost',
    path: '/addPost',
    component: AddPost
  }, {
    name: 'search',
    path: '/searchAr/:keyword/1',
    component: Search
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
